Skip to main content

All Questions

-1votes
3answers
234views

Mapping readings with labels [closed]

Given a list of readings in the following format: 1 1 0 0 2 3 23101 23101 0 0 2 0 5 2 0 0 1 1 0 0 2 2 23104 23104 0 0 1 0 5 1 0 0 What would be an approriate (and clean !) way to map them to their ...
Little Code's user avatar
3votes
5answers
449views

Get values block by block in same file

I have a file say "SAMPLE.txt" with following content, P1 10,9:6/123456 P2 blah blah P1 10,9:5/98765 P2 blah blah P1 blah blah P2 I want a output file say "RESULT.txt" as, Value1:123456 Value2:98765 ...
Garvit Khandelwal's user avatar
1vote
1answer
463views

Using kornshell or Perl to circumvent permissions needed by root

I have a problem where I need to change the ownership and permissions of one file that exists on more than 200 servers. I belong to 2 different groups and need to change the ownership from one group ...
etho201's user avatar
2votes
1answer
940views

how to replace IP address on remote host using expect

I wrote the following expect script in order to replace the IP address on remote Linux machine I use a perl one-liner for this task I get errors about can't read "HOME": no such variable , Please ...
maihabunash's user avatar
2votes
2answers
341views

ksh + delete number from string

the string IP include some IP address numbers as the following example echo ${IP[*]} 192.9.200.1 192.9.200.2 192.9.200.3 is it possible to remove some IP address number from the list ( using ksh ...
yael's user avatar
  • 1,325
1vote
2answers
967views

perl one liner + how to match IP address that located in the first/sec field of file

the following perl one liner syntax verify if IP address in "$IP" match the IP ADDRESS in file perl -ne 'BEGIN{$IP=shift} print if /(^|\s)\Q$IP\E(\s|$)/;' $IP file file have two fields as the ...
yael's user avatar
  • 1,325
0votes
2answers
351views

perl one liner + print VALUE in the end of the line

The following perl one liner checks if $CURRENT_VERSION matches $NEW_VERSION exactly, and prints it if it does. Example: CURRENT_VERSION=223.3.12.4.5.3 NEW_VERSION=223.3.12.4.5.3 DATE=17.3.2013 echo ...
yael's user avatar
  • 1,325
1vote
3answers
2kviews

linux/solaris + verify duplicate valid IP address from file

what the best way to find duplicate IP from file ( I have ksh script in this script I need to write function that check for duplicate IP ) for example if IP - 192.1926.23.52 exists twice in file - ...
yael's user avatar
  • 1,325
1vote
1answer
939views

Linux + replace STRING/WORD in file according to rule

My target is to replace any word/string/Any characters in file with new word/string according to the following rules: If numeric characters on the left side of word/string then we not replace the ...
yael's user avatar
  • 1,325
0votes
1answer
1kviews

linux + perl + replace any WORD in file with special characters with condition

Example1 work fine when I want to replace OLD_TEXT with NEW_TEXT ( its replace also all special characters as $@^%)(_+`:; etc ..) example1 export OLD_TEXT='$$OLD_WORD$$' export NEW_TEXT='$$...
user avatar

close